package com.dony.shop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dony.shop.domain.Discount;
import com.dony.shop.domain.Item;
import com.dony.shop.domain.vo.PublishShopVo;

import java.util.List;
import java.util.Map;

/**
 * 各站点价格配置Service接口
 *
 * @author sundw
 * @date 2022-08-30
 */
public interface IDiscountService extends IService<Discount> {


    /**
     * 同步折扣信息
     *
     * @param discount
     * @return
     */
    boolean syncByMerchantId(Discount discount);

    /**
     * 给所有未添加折扣的产品添加折扣
     *
     * @param merchantId
     * @return
     */
    Boolean addDiscountAll(Long merchantId);

    /**
     * 给选中的未添加折扣的产品添加折扣
     *
     * @param publishId
     * @return
     */
    Boolean addDiscountAll(Long[] publishId);


    /**
     * 给产品添加折扣
     *
     * @param itemId
     * @return
     */
    Boolean addDiscount(Long itemId);

    /**
     * 添加折扣
     *
     * @param publishTaskIds
     * @return
     */
    Boolean addPublishDiscount(Long[] publishTaskIds);

    /**
     * 更新所有折扣
     *
     * @return
     */
    Boolean addAllDiscount(Long merchantId);

    /**
     * 获取折扣列表
     * @param discount
     * @return
     */
    List<Discount> listDiscount(Discount discount);

    Boolean changeDiscountPrice(Long shopId, Long itemId, Map<Float, Float> priceMap);

    Boolean changeItemPrice(Item item, Map<Float, Float> priceMap);
}
